package com.smartstate.dataManagement.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;

@Data
@Entity
@TableName("device_care_plan")
@ApiModel(description = "设备保养计划实体类")
public class DeviceCarePlanEntity {

    @Id
    private int id;
    @TableField(value = "deviceId")
    private String deviceId;
    @TableField(value = "deviceName")
    private String deviceName;
    @TableField(value = "careTime")
    private String careTime;
    @TableField(value = "careCycle")
    private String careCycle;
    @TableField(value = "day")
    private String day;
    @TableField(value = "updateTime")
    private String updateTime;
    @TableField(value = "createUser")
    private String createUser;
    @TableField(value = "createTime")
    private String createTime;
    @TableField(value = "isAdd")
    private String isAdd;

    @Transient
    @TableField(exist = false)
    @ApiModelProperty(value = "状态， 0是无效即已经完成，1是有效即还没完成")
    private String  state;


    public DeviceCarePlanEntity() {}

    public DeviceCarePlanEntity(DeviceCarePlanBuilder deviceCarePlanBuilder){
        this.id=deviceCarePlanBuilder.id;
        this.isAdd=deviceCarePlanBuilder.isAdd;
        this.deviceId=deviceCarePlanBuilder.deviceId;
        this.deviceName=deviceCarePlanBuilder.deviceName;
        this.careTime=deviceCarePlanBuilder.careTime;
        this.careCycle=deviceCarePlanBuilder.careCycle;
        this.day=deviceCarePlanBuilder.day;
        this.updateTime=deviceCarePlanBuilder.updateTime;
        this.createTime=deviceCarePlanBuilder.createTime;
        this.createUser=deviceCarePlanBuilder.createUser;
    }

    public static  class   DeviceCarePlanBuilder{
        private  int id;
        private String deviceId;
        private String deviceName;
        private String careTime;
        private String careCycle;
        private String day;
        private String updateTime;
        private String createUser;
        private String createTime;
        private String isAdd;


        public DeviceCarePlanBuilder setId(int id) {
            this.id = id;
            return this;
        }

        public DeviceCarePlanBuilder setCareCycle(String careCycle) {
            this.careCycle = careCycle;
            return  this;
        }

        public DeviceCarePlanBuilder setIsAdd(String isAdd) {
            this.isAdd = isAdd;
            return  this;
        }

        public DeviceCarePlanBuilder setCareTime(String careTime) {
            this.careTime = careTime;
            return  this;
        }

        public DeviceCarePlanBuilder setDay(String day) {
            this.day = day;
            return  this;
        }

        public DeviceCarePlanBuilder setDeviceId(String deviceId) {
            this.deviceId = deviceId;
            return  this;
        }

        public DeviceCarePlanBuilder setDeviceName(String deviceName) {
            this.deviceName = deviceName;
            return  this;
        }

        public DeviceCarePlanBuilder setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
            return  this;
        }

        public DeviceCarePlanBuilder setCreateUser(String createUser) {
            this.createUser = createUser;
            return  this;
        }

        public DeviceCarePlanBuilder setCreateTime(String createTime) {
            this.createTime = createTime;
            return  this;
        }

        public  DeviceCarePlanEntity getBean(){
            return  new DeviceCarePlanEntity(this);
        }
    }




}
